<?php

use yii\db\Migration;

class m161022_064630_create_student extends Migration
{
    public function up()
    {
        $this->createTable('kd_student', [
               'xs_id'=>$this->primaryKey()->comment('学生id'),
               'xs_name'=>$this->char(20)->notNull()->comment('学生姓名'),

               'xs_xm'=>$this->char(20)->null()->comment('学生小名'),
               'xs_birth'=>$this->dateTime()->null()->comment('出生日期'),
               'xs_dad'=>$this->char(20)->null()->comment('爸爸'),
               'xs_mm'=>$this->char(20)->null()->comment('妈妈'),

               'xs_qs'=>$this->char(20)->null()->comment('学生亲属'),


               'xs_xb'=>$this->char(10)->notNull()->comment('学生性别'),

               'xs_age'=>$this->integer(20)->notNull()->comment('学生年龄'),
               'xs_height'=>$this->char(20)->notNull()->comment('学生身高'),
               'xs_weight'=>$this->string(20)->notNull()->comment('学生体重'),

               'yey_id'=>$this->integer(11)->notNull()->comment('幼儿园id'),
               'bj_id'=>$this->integer(11)->notNull()->comment('所属班级id'),
               'ls_id'=>$this->integer(11)->notNull()->comment('所属老师id'),
               'add_time'=>$this->dateTime()->notNull()->comment('添加时间'),

               'update_time'=>$this->dateTime()->notNull()->comment('修改时间'),
               'update_people'=>$this->string(50)->notNull()->comment('修改人'),

               

            ]);
    }

    public function down()
    {
        $this->dropTable('kd_student');
    }

    /*
    // Use safeUp/safeDown to run migration code within a transaction
    public function safeUp()
    {
    }

    public function safeDown()
    {
    }
    */
}
